package controllers

import (
	"github.com/astaxie/beego"
	"shopping/helper"
	order2 "shopping/models/order"
)

type OrderController struct {
	beego.Controller
}

func (this *OrderController) SaveOrder() {

	order_id := helper.Sti(this.GetString("order_id"))

	//存到数据库
	var order order2.MyOrder
	id := order.Addorder(order_id)

	resultjson := map[string]int64{"order_id": id, "error": 0}
	this.Data["json"] = &resultjson
	this.ServeJSON()

}

func (this *OrderController) SaveOrder2() {

	order_id := helper.Sti(this.GetString("order_id"))

	resultjson := map[string]int{"order_id": order_id, "error": 0}
	this.Data["json"] = &resultjson
	this.ServeJSON()

}